using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_List_of_PriceMap : EntityTypeConfiguration<so_List_of_Price>
    {
        public so_List_of_PriceMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Description, t.Type, t.Price_List });

            // Properties
            this.Property(t => t.item)
                .HasMaxLength(10);

            this.Property(t => t.Description)
                .IsRequired()
                .HasMaxLength(250);

            this.Property(t => t.Type)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Price_List)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("so_List_of_Price");
            this.Property(t => t.item).HasColumnName("item");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Price_List).HasColumnName("Price_List");
            this.Property(t => t.Price).HasColumnName("Price");
            this.Property(t => t.K).HasColumnName("K");
            this.Property(t => t.Are).HasColumnName("Are");
            this.Property(t => t.Or).HasColumnName("Or");
            this.Property(t => t.L).HasColumnName("L");
            this.Property(t => t.R).HasColumnName("R");
            this.Property(t => t.A).HasColumnName("A");
            this.Property(t => t.N).HasColumnName("N");
        }
    }
}
